#
# Simple makefile for LuaApplets
#

CXX := g++

CXXFLAGS := -O0 -g
#CXXFLAGS := -O2 -fomit-frame-pointer

LINKFLAGS := -llua -ltolua++ -lfltk2 -lfltk2_images -lpng -ljpeg

TOLUA_BIN := tolua++

TARGET_NAME := lua-applets

OBJECTS := main.o binding.o gui.o timer.o applet.o widget.o

all: lua-applets

lua-applets: $(OBJECTS)
	$(CXX) $(OBJECTS) -o $(TARGET_NAME) $(LINKFLAGS)

%.o: %.cpp
	$(CXX) $(CXXFLAGS) -c $< -o $@

binding.o: binding.pkg
	$(TOLUA_BIN) -n binding -o binding.cpp binding.pkg
	$(CXX) $(CXXFLAGS) -c binding.cpp -o binding.o

clean:
	rm -f $(OBJECTS)
	rm -f binding.cpp
	rm -f $(TARGET_NAME)
